package com.ljy.my_study.spring.tiny.study8.aop;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;

import org.aopalliance.intercept.MethodInvocation;

public class RefectiveMethodInvocation implements MethodInvocation{

	private Object target;
	private Method method;
	private Object[] args;
	
	public RefectiveMethodInvocation(Object target,Method method,Object[] args) {
		this.target=target;
		this.method=method;
		this.args=args;
	}
	
	@Override
	public Object[] getArguments() {
		return args;
	}

	@Override
	public Object proceed() throws Throwable {
		return method.invoke(target, args);
	}

	@Override
	public Object getThis() {
		return target;
	}

	@Override
	public AccessibleObject getStaticPart() {
		return null;
	}

	@Override
	public Method getMethod() {
		return method;
	}

}
